package chapter7.quarter2;

import java.io.*;

public class FileOutputSteamTest {
    public static void main(String[] args) {
        try {
            FileOutputStream out=new FileOutputStream("myFile.dat");
            out.write('H');
            out.write(69);
            out.write(76);
            out.write('L');
            out.write('O');
            out.write('!');
            out.close();

        }catch (FileNotFoundException e){
            System.out.println("error:cannot open file for writing");
        }catch (IOException e){
            System.out.println("error:cannot write to file");
        }
    }
}
